import service from '@/utils/request'
import qs from 'qs'
// eslint-disable-next-line no-unused-vars
const { httpPostForm, httpPost, httpGet } = service

const request = {
    // 根据中标通知书ID批量删除
    batchDelete (params) {
        return httpPost({
            url: '/tender/bidNotice/batchDelete',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            params: qs.stringify(params)
        })
    },
    // 新增中标通知书
    create (params) {
        return httpPost({
            url: '/tender/bidNotice/create',
            params
        })
    },
    // 根据招标通知书ID查询
    findById (id) {
        return httpGet({
            url: `/tender/bidNotice/findById/${id}`,
            // params,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 根据招标申请ID获取中标通知书列表
    getByTenderApplyId (tenderApplyId) {
        return httpGet({
            url: `/tender/bidNotice/getByTenderApplyId/${tenderApplyId}`,
            // params,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 更新中标通知书
    update (params) {
        return httpPost({
            url: '/tender/bidNotice/update',
            params
        })
    },
    // 根据招标申请ID获取候选人信息
    getCandidate (params) {
        return httpGet({
            url: '/tender/bidNotice/getCandidate',
            params,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 根据招标申请ID获取包件信息
    getPackage (params) {
        return httpGet({
            url: '/tender/bidNotice/getPackage',
            params,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 根据招标结果公示基础信息ID（billId） 获取候选人信息
    candidateGetCandidate (billId) {
        return httpGet({
            url: `/tender/publicity/candidate/getCandidate/${billId}`,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 根据招标结果公示基础信息ID获取投诉受理人
    getComplaintInfo (billId) {
        return httpGet({
            url: `/tender/publicity/complain/getComplaintInfo/${billId}`,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 根据公示基础信息（billId）获取公示内容
    contentFindById (billId) {
        return httpGet({
            url: `/tender/publicity/content/findById/${billId}`,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded'
            }
        })
    },
    // 新增公示内容
    contentCreate (params) {
        return httpPost({
            url: '/tender/publicity/content/create',
            params,
        })
    },
    // 更新公示内容
    contentUpdate (params) {
        return httpPost({
            url: '/tender/publicity/content/update',
            params,
        })
    },
    // 新增投诉受理人
    complainCreate (params) {
        return httpPost({
            url: '/tender/publicity/complain/create',
            params,
        })
    },
}

export default request
